import { RouteRecordRaw } from "vue-router";

const allRouter: RouteRecordRaw[] = [
  {
    path: "/",
    component: () => import("@/views/Home/Index.vue"),
    redirect: "/index",
    name: "Home",
    meta: {},
    children: [
      {
        path: "index",
        component: () => import("@/views/Home/Index.vue"),
        name: "Index"
      }
    ]
  },
  {
    path: "/403",
    component: () => import("@/views/Error/403.vue"),
    name: "NoAccess",
    meta: {
      hidden: true,
      title: "403",
      noTagsView: true
    }
  },
  {
    path: "/404",
    component: () => import("@/views/Error/404.vue"),
    name: "NoFound",
    meta: {
      hidden: true,
      title: "404",
      noTagsView: true
    }
  },
  {
    path: "/500",
    component: () => import("@/views/Error/500.vue"),
    name: "Error",
    meta: {
      hidden: true,
      title: "500",
      noTagsView: true
    }
  },
  {
    path: "/test",
    component: () => import("@/views/Test/Index.vue"),
    name: "Test",
    children: [
      {
        path: "icon",
        component: () => import("@/views/Test/Icon/Index.vue"),
        name: "TestIcon"
      }
    ]
  },
  {
    path: "/test/form",
    component: () => import("@/views/Test/Form/Index.vue"),
    name: "TestForm",
    children: []
  },
  {
    path: "/test/createForm",
    component: () => import("@/views/Test/CreateForm/Index.vue"),
    name: "TestCreateForm",
    children: []
  },
  {
    path: "/test/formDesigner",
    component: () => import("@/views/Test/FormDesigner/Index.vue"),
    name: "TestFormDesigner",
    children: []
  },
  {
    path: "/test/bpmn1",
    component: () => import("@/views/Test/Bpmn/Index1.vue"),
    name: "TestBpmn1",
    children: []
  },
  {
    path: "/test/bpmn",
    component: () => import("@/views/Test/Bpmn/Index.vue"),
    name: "TestBpmn",
    children: []
  },
  {
    path: "/test/icon",
    component: () => import("@/views/Test/Icon/Index.vue"),
    name: "TestIcon",
    children: []
  },
  {
    path: "/test/user",
    component: () => import("@/views/Test/User/Index.vue"),
    name: "TestUser",
    children: [
      {
        path: ":userId",
        component: () => import("@/views/Test/User/Detail.vue"),
        name: "TestUserDetail"
      }
    ]
  },
  // 找不到页面跳转到404
  {
    path: "/:path(.*)*",
    redirect: "/404",
    name: "404Page"
  }
];

export default allRouter;
